package no.sachmuld.methodcombination.examples.reflection.roles.observer;

/**
 *
 */
public class Main implements Runnable {

    @Override
    public void run() {

        Observer fooObserver = new Observer() {
            @Override
            public void update(Object observable) {
                System.out.println(observable + " changed!");
            }
        };

        Foo foo = new Foo().with(new ObservableBehaviour());

        foo.as(Observable.class).addObserver(fooObserver);

        foo.bar(1);

    }

    static public void main(String... args) {

        new Main().run();

    }
}
